package com.cplatform.movie.back.order.service;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cplatform.dbhelp.DbHelper;
import com.cplatform.dbhelp.page.Page;
import com.cplatform.movie.back.order.dao.OrderDao;
import com.cplatform.movie.back.order.entity.Order;

/**
 * Title. <br>
 * Description.
 * <p>
 * Copyright: Copyright (c) 2015年6月29日 上午10:10:43
 * <p>
 * Author: liuyt
 * <p>
 * Version: 1.0
 * <p>
 */
@Service
public class OrderService {
	@Autowired
	private OrderDao orderDao;
	@Autowired
	private DbHelper dbHelper;

	/**
	 * @throws SQLException 
	 * @Title: 获取订单分页数据 <br>
	 * @param order
	 * @param page
	 * @return
	 * @throws
	 */
	public Page<Order> list(Order order, int page) throws SQLException {
		StringBuilder sql = new StringBuilder("select t.* from t.T_SMALL_SHOP_ORDER t ");
		sql.append("order by t.id desc");
		// List<Object> paramList = new ArrayList<Object>();
		return dbHelper.getPage(sql.toString(), Order.class, page, Page.DEFAULT_PAGESIZE, null);
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
